/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.trainning.thompv.btvn2;
import java.util.Scanner;
/**
 *
 * @author SONY
 */
public class Bai8 {
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        String s;
        System.out.println("Nhap xau:");
        s=sc.nextLine();
        String s1[]=s.split(" ");
        for(int i=0;i<s1.length-1;i++)
            for(int j=i+1;j<s1.length;j++)
                if(s1[i].compareTo(s1[j])>0)
                {
                    String tmp=s1[i];
                    s1[i]=s1[j];
                    s1[j]=tmp;
                }
        System.out.println("Cac tu sau khi da sap xep theo thu tu Alphabet:");
        for(int i=0;i<s1.length-1;i++)
            System.out.print(s1[i]+" ");
        System.out.println(s1[s1.length-1]);
    }
}
